<template>
  <van-card v-for="user in props.userList"
            :price="user.planetCode"
            :desc="user.personalProfile"
            :title="`${user.username}<${user.planetCode}>`"
            :thumb="user.avatarUrl"
            currency="⭐️"
            :tag="user.gender === 0 ? '♂' : ' ♀ '"
  >
    <template #tags>
      <van-tag  type="success" plain v-for="tag in user.tags" style="margin-right: 8px;margin-top: 4px">
        {{tag}}
      </van-tag>
    </template>
    <template #footer>
      <van-button size="mini" @click="toUserInfo(user)">联系我</van-button>
    </template>
  </van-card>
</template>

<script setup lang="ts">

import {useRouter} from "vue-router";
import {userStore} from "../stores/user/user.ts";

const props = defineProps(['userList']);


const router = useRouter();
const userStoreAPI = userStore();

//前往用戶信息页面
const toUserInfo = (user:any)=>{
  userStoreAPI.setOtherUserInfo(user);
  router.push('/userInfo');
};


</script>



<style scoped>

</style>